package com.hzqy.persistence.dao.epg;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.epg.AcRecordVo;

import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class AcRecordDao extends PersistenceDao<AcRecordVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	/**
	 * 条件查询数量
	 * */
	public Integer selectAcCount(Map map){
        return getSqlSession().selectOne(this.getNamespace()+"selectAcCount",map);
    }

	/**
	* 动态查询信息传递实体为参数
	* */
	public List<AcRecordVo> selectAcByRequest(Map map){
		return getSqlSession().selectList(this.getNamespace()+"selectAcByRequest",map);
	}
	//修改
	public int updateRecord(AcRecordVo acRecordVo) {
		return getSqlSession().update(this.getNamespace()+"updateAcBFRecord", acRecordVo);
	}
	//添加
	public int insertRecord(AcRecordVo acRecordVo) {
		return getSqlSession().insert(this.getNamespace()+"insertAcBFRecord", acRecordVo);
	}
	//删除
	public int deleteRecord(int f_ar_id) {
		return getSqlSession().delete(this.getNamespace()+"deleteAcBFRecord", f_ar_id);
	}
	// 列表
	public List<AcRecordVo> selectServerList (Map map) {
		return getSqlSession().selectList(this.getNamespace()+"selectServerList", map);
	}
	
	//总条数
	public int selectServerCount (Map map) {
		String namespace2 = this.getNamespace();
		SqlSession sqlSession2 = getSqlSession();
		int i =  sqlSession2.selectOne(namespace2+"selectServerCount",map);
		return i;
	}
	//删除
	public AcRecordVo selectRecordById(int f_ar_id) {
		return getSqlSession().selectOne(this.getNamespace()+"selectRecordById", f_ar_id);
	}


}
